package com.aos.erp.message.model;

import com.aos.erp.message.enums.DelStatus;
import com.aos.erp.message.enums.PushStatus;
import com.aos.erp.message.enums.PushType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel("消息推送记录")
@TableName("t_message_record")
public class MessageRecordInfo implements Serializable {

    @ApiModelProperty(value="记录ID",hidden=true)
    @TableId(value = "id", type = IdType.INPUT)
    private long id = 0;
    @ApiModelProperty(value="推送模板ID",hidden=true)
    @TableField("mt_id")
    private long mtId = 0;  // 推送模板ID
    @ApiModelProperty(value="推送模板编号",hidden=true)
    @TableField("mt_code")
    private String mtCode = "";  // 推送模板编号
    @ApiModelProperty(value="推送标题",hidden=true)
    @TableField("mr_title")
    private String mrTitle = "";    // 推送标题
    @ApiModelProperty(value="推送方式(app:APP；wx_public:微信公众号；wx_applet:微信小程序；sms:短信)",hidden=true)
    @TableField("push_type")
    private PushType pushType=PushType.app; // 推送方式
    @ApiModelProperty("推送状态：push_no为未发送；push_yes为已发送；push_stop为暂停发送")
    @TableField("push_status")
    private PushStatus pushStatus=PushStatus.push_no;   // 推送状态
    @ApiModelProperty("是否删除：del_no为未删除；del_yes为已删除")
    @TableField("is_del")
    private DelStatus isDel = DelStatus.del_no;
    @ApiModelProperty(value="推送次数",hidden=true)
    @TableField("mr_push_count")
    private int mrPushCount = 0; // 推送次数
    @ApiModelProperty(value="接收人手机号",hidden=true)
    @TableField("mr_recipient_phone")
    private String mrRecipientPhone="";
    @ApiModelProperty(value="接收人（学员身份证号）",hidden=true)
    @TableField("mr_recipient_id_no")
    private String mrRecipientIdNo = "";
    @ApiModelProperty(value="接收人（学员姓名）",hidden=true)
    @TableField("mr_recipient")
    private String mrRecipient = "";
    @ApiModelProperty(value="发送驾校ID",hidden=true)
    @TableField("mr_ds_id")
    private long mrDsId = 0;
    @ApiModelProperty(value="发送驾校名称",hidden=true)
    @TableField("mr_ds_name")
    private String mrDsName = ""; // 发送人
    @ApiModelProperty(value="消息内容",hidden=true)
    @TableField("mr_content")
    private String mrContent = "";
    @ApiModelProperty(value="消息参数",hidden=true)
    @TableField("mr_msg_params")
    private String mrMsgParams = "";  // 消息参数
    @ApiModelProperty(value="操作人",hidden=true)
    @TableField("mr_sender_name")
    private String mrSenderName = ""; // 发送人
    @ApiModelProperty(value="提交时间",hidden=true)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("submit_time")
    private Date submitTime;    // 提交时间
    @ApiModelProperty(value="发送时间",hidden=true)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("push_time")
    private Date pushTime;    // 发送时间
    @ApiModelProperty(value="推送结果",hidden=true)
    @TableField("push_result")
    private String pushResult = "";

    public String getPushTypeName() {
        return pushType.getDesc();
    }

    public String getPushStatusName() {
        return pushStatus.getDesc();
    }
}
